"use strict";

const channels = require("./channels");
const objectAssign = require("object-assign");

/**
 * Set credentials for the bot.
 *
 * @return {Object} credentials
 * @return {string} credentials.name
 * @return {Object} credentials.options
 * @return {boolean} credentials.options.debug
 * @return {Object} credentials.connection
 * @return {string} credentials.connection.cluster
 * @return {boolean} credentials.connection.reconnect
 * @return {Object} credentials.identity
 * @return {string} credentials.identity.username
 * @return {string} credentials.identity.password
 * @return {string[]} credentials.channels
 */

module.exports.dev = function() {
  require("dotenv-safe").load();
  const credentials = objectAssign(
    {},
    {
      name: "dev",
      options: {
        debug: true
      },
      connection: {
        cluster: "chat",
        reconnect: true
      },
      identity: {
        username: process.env.BOT_USERNAME,
        password: process.env.BOT_PASSWORD
      }
    }, {
      channels: channels.dev
    });
  return credentials;
};
